package com.qjdchina.sku.converter;

import org.springframework.beans.BeanUtils;

import com.qjdchina.sku.model.Category;
import com.qjdchina.sku.model.vo.CategoryMenuVO;

public class CategoryConverter {

	
	private CategoryConverter(){
		
	}
	
	public static CategoryMenuVO toCategoryVO(Category category){
		
		CategoryMenuVO categoryMenuVO=new CategoryMenuVO();
		if (null==category) {
			return categoryMenuVO;
		}
		BeanUtils.copyProperties(category, categoryMenuVO);
		return categoryMenuVO;
	}
	
	public static Category toCategory(CategoryMenuVO categoryMenuVO){
		
		Category category=new Category();
		if (null==categoryMenuVO) {
			return category;
		}
		BeanUtils.copyProperties(categoryMenuVO, category);
		return category;
	}
	

}
